package model.Actions;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import DB.Connection.DBConnectionManager;
import controller.ControllerFunctions;

public class addFavoriteToDBAction implements Runnable {

	private static final Log logger = LogFactory.getLog(addCharacterCommentAction.class);

	private Integer userID;
	private Integer characterID;

	public addFavoriteToDBAction(Integer userID, Integer characterID) {
		this.userID = userID;
		this.characterID = characterID;
	}

	@Override
	public void run() {
		logger.info("addFavoriteToDBAction starting...");

		DBConnectionManager.get().insertToFavoritesTable(userID, characterID);
		ControllerFunctions.get().getUserFavorites(userID);

		logger.info("addFavoriteToDBAction ended.");
	}
}